<?php
namespace app\admin\model\system;

use support\Model;
use think\model\concern\SoftDelete;

class SystemRoleModel extends Model
{
    protected $name = 'system_role';
    protected $pk = 'id';


    /**
     * 获取权限
     * @param array $where
     * @param string|null $field
     * @param string|null $key
     * @return array
     */
    public function getRole(array $where = [], ?string $field = null, ?string $key = null)
    {
        return $this->where($where)->column($field ?: 'role_name', $key ?: 'id');
    }

}